package dancrawler.server;

import dancrawler.proto.cmd.NetCommand;

/**
 *
 */
public class netMsg {
    private short cmd;
    private short id;
    private byte[][] args;
    private boolean finalized = false;
    private int arg = -1, index = 0;
    private Connection sender, target;
    private NetCommand cmdObj;

    public NetCommand getCmdObj() {
        return cmdObj;
    }

    public void setCmdObj(NetCommand cmdObj) {
        this.cmdObj = cmdObj;
    }

    public boolean isFinalized() {
        return finalized;
    }

    public void setFinalized(boolean finalized) {
        this.finalized = finalized;
    }

    public int getArg() {
        return arg;
    }

    public void setArg(int arg) {
        this.arg = arg;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public netMsg(short cmd, short id, Connection con) {
        this.cmd = cmd;
        this.id = id;
        sender = con;
    }

    public short getCmd() {
        return cmd;
    }

    public void setCmd(short cmd) {
        this.cmd = cmd;
    }

    public short getId() {
        return id;
    }

    public void setId(short id) {
        this.id = id;
    }

    public byte[][] getArgs() {
        return args;
    }

    public void setArgs(byte[][] args) {
        this.args = args;
    }
    public Connection getSender()
    {
        return sender;
    }

    public Connection getTarget() {
        return target;
    }

    public void setTarget(Connection target) {
        this.target = target;
    }
    
}
